package com.xlh.lib.Core;

import android.content.Context;
import android.os.*;
import android.text.Spanned;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.xlh.Utils.Constant;
import com.xlh.Utils.ProtocolParser;
import com.xlh.bean.CenterText;
import com.xlh.interf.IActivity;
import com.xlh.outside.MainActivity;

/**
 * Created by Administrator on 2018/7/3.
 */

public class ServerCommHelper {
    private IActivity atv;


    public ServerCommHelper(IActivity atv) {
       this.atv = atv;
       //this.context = context;
    }


    /**
     * 隐藏所有出口
     */
    public void hideAllExits(){

        for(TextView e : this.atv.getActivity().exitsMap.keySet()){
            e.setVisibility(View.INVISIBLE);
            e.setText("");
        }
    }
    //设置方向键中间名称
    public<T>void setCurrentExits(Spanned t){
            this.atv.getActivity().getDirTv05().setVisibility(View.VISIBLE);
            this.atv.getActivity().getDirTv05().setText(t);


    }



    /**
     * 根据内容隐藏出口
     */
    public void hideDirByValue(String dir){
        for(TextView e : this.atv.getActivity().exitsMap.keySet()){
            if(this.atv.getActivity().exitsMap.get(e).contains(dir)){
                e.setVisibility(View.INVISIBLE);
                e.setText("");
            }
        }
    }








}
